package com.kzw.entity;

import java.util.Date;

/**
 * 文章
 */
public class Article {

	private Long id;
	// 标题
	private String title;
	// 发表时间
	private Date ctime = new Date();
	// 类别
	private Dictionary type;
	private Long typeId;
	// 标题图
	private String titlePic;
	// 内容
	private String content;

	/**
	 * 获得纯文本内容
	 * */
	public String getText() {
		if(content == null) return "";
		return content.replaceAll("</?[^>]+>", "").replaceAll("<a>\\s*|\t|\r|\n</a>", "").replaceAll("&nbsp;", "");	
	}	
	
	public Long getId() {
		return id;
	}

	public String getTitle() {
		return title;
	}

	public Date getCtime() {
		return ctime;
	}

	public Dictionary getType() {
		return type;
	}

	public Long getTypeId() {
		return typeId;
	}

	public String getTitlePic() {
		return titlePic;
	}

	public String getContent() {
		return content;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public void setCtime(Date ctime) {
		this.ctime = ctime;
	}

	public void setType(Dictionary type) {
		this.type = type;
	}

	public void setTypeId(Long typeId) {
		this.typeId = typeId;
	}

	public void setTitlePic(String titlePic) {
		this.titlePic = titlePic;
	}

	public void setContent(String content) {
		this.content = content;
	}

}
